﻿<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="@{'update service'+${service.name}}"></title>
</head>
<body>

<div id="div_wrapper" class="row-cols-lg-1">
    <h1 th:text="@{'update service'+${service.name}}"></h1>
    <form id="update_form"
          action="/info/update"
          method="post"
          class="flex-box"
          onsubmit="onSubmit()"
    >
        <label for="name">name
            <input id="name" type="text"
                   name="name" th:value="${service.name}">
        </label>
        <br>
        <label for="domain">domain
            <input id="domain" type="text"
                   name="domain" th:value="${service.domain}">
        </label>
        <br>
        <label for="port">port
            <input id="port" type="text"
                   name="port" th:value="${service.port}">
        </label>
        <br>
        <button type="submit">Update</button>
    </form>
    <a href="..">Back to chatroom</a><br>
    <a href="../info">Back to details</a>
    <a href="./update">refresh</a>
</div>
<script>
    function onSubmit() {
        /*let form = document.getElementById("update_form")
        // let name_field = document.getElementById("name")
        // let service_name = name_field.value
        // form.action = "/update/" + service_name*/
    }
</script>
</body>
</html>